<?php
require_once 'include/base.php';
require_once 'include/topwrap.php';
require_once 'include/global.func.php';
require_once 'inc/config.php';
require_once 'inc/classes/db.php';
$db = new db($gDb);

$categories = include('categories.php');
$taoapi = new TopWrap(false,true);
$cates  = $taoapi->getItemCats();
$__tmp  = array('服饰美容','电子数码','居家生活');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="淘宝商品分类大全" />
<meta name="description" content="淘宝商品分类大全" />
<title>产品分类大全</title>
<link type="text/css" rel="stylesheet" href="static/search.css" />
<style>
.categories-container{ width:990px; }
.categories-wrap{ height:auto;padding:12px 15px; }
.categories-wrap dl{border:medium none;clear:both;margin:0;padding:0;}
.categories-wrap dl dt, .categories-wrap dl dd{ display:block; float:left; font-size:12px; margin:3px 0; overflow:visible;padding:0;white-space:nowrap;}
.categories-wrap dl dt{ font-weight:600;}
.categories-wrap dl dd.clear { clear:both; font-size:0;height:0;margin:0;padding:0;visibility:hidden;}
.categories-wrap dl dd .vertical {color:#BBBBBB;padding:0 7px;}
.categories-wrap h1 {background:#EEE; border-bottom:1px solid #BBBBBB;font-size:16px;height:30px;line-height:35px;padding-left:15px;}
.categories-wrap dl dd a, .categories-wrap dl dt a {color:#333333;}
.categories-wrap h1 a, .categories-wrap dl dt a:hover, .categories-wrap dl dd a:hover {color:#B20000;}
</style>
</head>

<body>
<?php include('blocks/nav.php');?>
<div id="item-container" style="line-height:25px;">
	<div class='search-nav'><a href="itemsearch.php">搜索首页</a> -> 分类大全</div>
	<?php for($i=0;$i<count($categories); $i++):?>
	<div class="categories-container">
		<div class="categories-wrap">
        	<h1><a href="#"><?php echo $__tmp[$i];?></a></h1>
			<?php foreach($categories[$i] as $cate):?>
			<dl>
            	<?php if($cate[0][0] == 1): ?>
                <dt><a href="itemsearch.php?q=<?php echo $cate[0][1]; ?>" target="_blank"><?php echo $cate[0][1];?></a></dt>
                <?php endif; ?>
				<dt><a href="list-<?php echo $cate[0][0]; ?>" target="_blank"><?php echo $cate[0][1];?></a></dt>
				<?php for($z=1;$z<count($cate);$z++):?>
                <?php if($cate[$z][0] == 1): ?>
                <dd><span class="vertical">|</span><a href="itemsearch.php?q=<?php echo $cate[$z][1]; ?>" target="_blank"><?php echo $cate[$z][1];?></a></dd>
                <?php else: ?>
                <dd><span class="vertical">|</span><a href="list.php?catid=<?php echo $cate[$z][0]; ?>&kw=<?php echo urlencode($cate[$z][1]); ?>" target="_blank"><?php echo $cate[$z][1];?></a></dd>
                <?php endif; ?>
				<?php endfor;?>
                <dd class="clear"></dd>
			</dl>
			<?php endforeach;?>
		</div>
	</div>
	<?php endfor;?>
</div>
<?php include('blocks/footer.php'); ?>

</body>
</html>
